var status = -1;
var selectionLog = [];

function action(d, h, j) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = j;
    var c = -1;
    if (status <= c++) {
        cm.dispose()
    } else {
        if (status === c++) {
            var g = ["mirrorD_327_0_", "mirrorD_327_1_", "mirrorD_327_2_", "mirrorD_327_3_"];
            var a = [0, 0, 0, 0];
            var b = ["为制作暴走的订单，不停地在赶工的玩具工厂。", "将玩具城停滞的时间禁锢着的时间塔内部。", "堆满了玩具工厂库存的时间塔最下层。", "据说可以将玩具城被封印的时间解除掉的时间塔最下层。"];
            var f = new Array();
            var e = 41801 + parseInt((cm.getMapId() - 320000000) / 1000000) * 4 - 4;
            for (var c = 0; c < b.length; c++) {
                if (cm.getNumberFromQuestInfo(e + c, "count") > 0) {
                    f.push(b[c] + "\n\n通关次数:" + cm.getNumberFromQuestInfo(e + c, "count") + "\r\n最短纪录:" + cm.getNumberFromQuestInfo(e + c, "min") + "分 " + cm.getNumberFromQuestInfo(e + c, "sec") + "秒")
                } else {
                    f.push(b[c] + "\n\n通关次数:- \r\n最短纪录:-分 -秒")
                }
            }
            cm.setMirrorDungeonInfo(g, a, f);
            cm.dispose();
            if (cm.isQuestActive(40960) && cm.isQuestFinished(40600)) {
                cm.forceCompleteQuest(40960)
            }
            if (cm.isQuestActive(40961) && cm.isQuestFinished(40601)) {
                cm.forceCompleteQuest(40961)
            }
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};